﻿using Biomedica.Graphics;
using Microsoft.Kinect;
using NuiDicomPlayer.Nui.Gestures;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NuiDicomPlayer.Nui.NavigationEngine
{
    public class BothHandsBetweenHeadAndSpineDetector : Detectors
    {
        private bool detected;
        public Boolean IsDtected { get { return detected; } }
        public Boolean IsDetected(Skeleton[] BufferdSkeletons)
        {
                    Vector3 MA_head = this.FindMA(Microsoft.Kinect.JointType.Head);
                    Vector3 MA_Spine = this.FindMA(Microsoft.Kinect.JointType.Spine);

                    Vector3 MA_Left_hand = this.FindMA(Microsoft.Kinect.JointType.HandLeft);
                    Vector3 MA_Right_hand = this.FindMA(Microsoft.Kinect.JointType.HandRight);

                    detected = (MA_Left_hand.Y < MA_head.Y) & (MA_Right_hand.Y < MA_head.Y) & (MA_Left_hand.Y > MA_Spine.Y) & (MA_Right_hand.Y > MA_Spine.Y);
               
                
            

            return detected;
        }
    }
}
